package com.servlet;

import com.dao.UserInfDao;
import com.entity.productdetails;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class zhifu extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String s= (String) req.getSession().getAttribute("zhifu");
        String sql="select * from productdetails where PDID=?";
        UserInfDao u=new UserInfDao();
        List<productdetails> list=u.getForList(productdetails.class,sql,s);
        List<productdetails> list1 = new ArrayList<>(list);
        req.setAttribute("zf",list1);
        req.getRequestDispatcher("/zhifuqueren.jsp").forward(req,resp);
    }
}
